{smcl}
{com}{sf}{ul off}{txt}{.-}
      name:  {res}<unnamed>
       {txt}log:  {res}/Users/AliceZhang/Dropbox/Research_Columbia/Renewables Voting (Urpelainen Zhang)/JOP/UZ_JOP2021_Replication/Analysis/logSTATA/008_robustness_comments.smcl
  {txt}log type:  {res}smcl
 {txt}opened on:  {res} 6 Nov 2021, 20:34:06
{txt}
{com}. 
. 
. *******************************************************************************
. /*                                        URPELAINEN & ZHANG 2021                                                */
. *******************************************************************************
. 
. /* 
> 
> File Name:      008_robustness_comments.do
> 
> By:                             Alice Tianbo Zhang (alice.tianbo.zhang@gmail.com)
> 
> Last Edited:    10/11/2021
> 
> Purpose:                
> 
> Data Used:      votes_wind_panel.dta
> 
> Program Used:   - reghdfe -
> 
> */
. 
. *******************************************************************************
. /*                                      Instrument Stationarity                                              */
. *******************************************************************************
. 
. ** Load wind votes panel
. cd "$rootDir/$dataDir/Final"
{res}/Users/AliceZhang/Dropbox/Research_Columbia/Renewables Voting (Urpelainen Zhang)/JOP/UZ_JOP2021_Replication/Data/Final
{txt}
{com}. use votes_wind_panel.dta, clear
{txt}
{com}. 
. ** Create instrument and fixed effects
. gen t = year - 2003
{txt}
{com}. gen inter = t * mean_wp
{txt}
{com}. 
. egen stateyear_fixed = group(state year)
{txt}
{com}. egen district_fixed = group(state district)
{txt}
{com}. 
. gen cum_lncapacity_turbine = log(cum_capacity_turbine + 1)
{txt}
{com}. gen cum_lncount_turbine = log(cum_count_turbine +1 )
{txt}
{com}. 
. 
. *------------------- Check for stationarity of instrument --------------------*
. // Note: the instrument is a time-invariant variable (mean wind potential) * time trend, so it should be stationary by construction
. xtdescribe

 {txt}panelID:  {res}9{txt}, {res}10{txt}, ..., {res}434                                   {txt}n ={res}        287
    {txt}year:  {res}2003, 2004, ..., 2012                             {txt}T ={res}         10
           {txt}Delta(year) = {res}1 unit
           {txt}Span(year)  = {res}10 periods
           {txt}(panelID*year uniquely identifies each observation)

Distribution of T_i:   min      5%     25%       50%       75%     95%     max
                    {res}    10      10      10        10        10      10      10

{txt}{col 6}Freq.  Percent    Cum. {c |}  Pattern
 {hline 27}{c +}{c -}{c -}{hline 10}
{res}      287    100.00  100.00{txt} {c |}  {res}1111111111
{txt} {hline 27}{c +}{c -}{c -}{hline 10}
{res}      287    100.00        {txt} {c |}  {res}XXXXXXXXXX
{txt}
{com}. xtunitroot ht inter, demean trend //  assume all panels share the same autoregressive parameter and N --> infinity, T is fixed

{txt}Harris-Tzavalis unit-root test for {res}inter
{txt}{hline 40}
Ho: Panels contain unit roots{col 45}Number of panels{col 63}={col 64}{res}    287
{txt}Ha: Panels are stationary{col 45}Number of periods{col 63}={col 64}{res}     10

{txt}AR parameter: {res}Common{txt}{col 45}Asymptotics: {res}N -> Infinity
{txt}Panel means:  {res}Included{col 58}T Fixed
{txt}Time trend:   {res}Included{txt}{col 45}Cross-sectional means removed
{hline 78}
{col 21}Statistic{col 39}z{col 49}p-value
{hline 78}
{col 2}rho{res}{col 21} -0.1711{col 35}-25.9036{col 50}0.0000
{txt}{hline 78}

{com}. 
. 
. *******************************************************************************
. /*                                                      TABLE A21                                                            */
. *******************************************************************************
. 
. *--------------------- Placebo test in districts w/o wind --------------------* 
. use votes_wind_panel.dta, clear
{txt}
{com}. gen t = year - 2003
{txt}
{com}. gen inter = t * mean_wp
{txt}
{com}. 
. egen stateyear_fixed = group(state year)
{txt}
{com}. egen district_fixed = group(state district)
{txt}
{com}. 
. gen cum_lncapacity_turbine = log(cum_capacity_turbine + 1)
{txt}
{com}. gen cum_lncount_turbine = log(cum_count_turbine +1 )
{txt}
{com}. 
. ** Check the effect of instrument on environmental voting outcomes for districts with no wind power
. reghdfe pro_env inter if cum_capacity_turbine == 0 & raceyear > 2003, absorb(stateyear_fixed district_fixed) vce(cluster district_fixed)
{res}{txt}(dropped 35 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 9 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     1,713
{txt}Absorbing 2 HDFE groups{col 51}F({res}   1{txt},{res}    238{txt}){col 67}= {res}      0.05
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.8189
{txt}{col 51}R-squared{col 67}= {res}    0.8842
{txt}{col 51}Adj R-squared{col 67}= {res}    0.8479
{txt}{col 51}Within R-sq.{col 67}= {res}    0.0000
{txt}{col 1}Number of clusters ({res}district_fixed{txt}) {col 30}= {res}       239{txt}{col 51}Root MSE{col 67}= {res}   15.3675

{txt}{ralign 78:(Std. Err. adjusted for {res:239} clusters in district_fixed)}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}     pro_env{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 7}inter {c |}{col 14}{res}{space 2}-.1144223{col 26}{space 2} .4992476{col 37}{space 1}   -0.23{col 46}{space 3}0.819{col 54}{space 4}-1.097931{col 67}{space 3} .8690862
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 62.96065{col 26}{space 2} 4.109534{col 37}{space 1}   15.32{col 46}{space 3}0.000{col 54}{space 4} 54.86495{col 67}{space 3} 71.05636
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 17}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}     Absorbed FE{col 18}{c |} Categories{col 31} - Redundant{col 43}  = Num. Coefs{col 58}{c |}
{res}{col 1}{text}{hline 17}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} stateyear_fixed{col 18}{c |}{space 1}      170{col 31}{space 1}        0{col 43}{result}{space 1}      170{col 57}{text} {col 58}{c |}
{res}{col 1}{text}  district_fixed{col 18}{c |}{space 1}      239{col 31}{space 1}      239{col 43}{result}{space 1}        0{col 57}{text}*{col 58}{c |}
{res}{col 1}{text}{hline 17}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}. estimates store pro_reduced
{txt}
{com}. reghdfe anti_env inter if cum_capacity_turbine == 0 & raceyear > 2003, absorb(stateyear_fixed district_fixed) vce(cluster district_fixed)
{res}{txt}(dropped 35 {browse "http://scorreia.com/research/singletons.pdf":singleton observations})
{res}{txt}({browse "http://scorreia.com/research/hdfe.pdf":MWFE estimator} converged in 9 iterations)
{res}
{txt}HDFE Linear regression{col 51}Number of obs{col 67}= {res}     1,713
{txt}Absorbing 2 HDFE groups{col 51}F({res}   1{txt},{res}    238{txt}){col 67}= {res}      0.12
{txt}Statistics robust to heteroskedasticity{col 51}Prob > F{col 67}= {res}    0.7330
{txt}{col 51}R-squared{col 67}= {res}    0.8890
{txt}{col 51}Adj R-squared{col 67}= {res}    0.8542
{txt}{col 51}Within R-sq.{col 67}= {res}    0.0001
{txt}{col 1}Number of clusters ({res}district_fixed{txt}) {col 30}= {res}       239{txt}{col 51}Root MSE{col 67}= {res}   14.8268

{txt}{ralign 78:(Std. Err. adjusted for {res:239} clusters in district_fixed)}
{hline 13}{c TT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{col 14}{c |}{col 26}    Robust
{col 1}    anti_env{col 14}{c |}      Coef.{col 26}   Std. Err.{col 38}      t{col 46}   P>|t|{col 54}     [95% Con{col 67}f. Interval]
{hline 13}{c +}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{space 7}inter {c |}{col 14}{res}{space 2}-.2036898{col 26}{space 2} .5963818{col 37}{space 1}   -0.34{col 46}{space 3}0.733{col 54}{space 4}-1.378551{col 67}{space 3} .9711713
{txt}{space 7}_cons {c |}{col 14}{res}{space 2} 36.01152{col 26}{space 2}  4.90909{col 37}{space 1}    7.34{col 46}{space 3}0.000{col 54}{space 4}  26.3407{col 67}{space 3} 45.68234
{txt}{hline 13}{c BT}{hline 11}{hline 11}{hline 9}{hline 8}{hline 13}{hline 12}
{res}
{txt}Absorbed degrees of freedom:
{res}{col 1}{text}{hline 17}{c TT}{hline 12}{hline 12}{hline 14}{hline 1}{c TRC}
{col 1}{text}     Absorbed FE{col 18}{c |} Categories{col 31} - Redundant{col 43}  = Num. Coefs{col 58}{c |}
{res}{col 1}{text}{hline 17}{c +}{hline 12}{hline 12}{hline 14}{hline 1}{c RT}
{col 1}{text} stateyear_fixed{col 18}{c |}{space 1}      170{col 31}{space 1}        0{col 43}{result}{space 1}      170{col 57}{text} {col 58}{c |}
{res}{col 1}{text}  district_fixed{col 18}{c |}{space 1}      239{col 31}{space 1}      239{col 43}{result}{space 1}        0{col 57}{text}*{col 58}{c |}
{res}{col 1}{text}{hline 17}{c BT}{hline 12}{hline 12}{hline 14}{hline 1}{c BRC}
* = FE nested within cluster; treated as redundant for DoF computation
{res}{txt}
{com}. estimates store anti_reduced
{txt}
{com}. 
. ** Export LaTeX tables (IV estimates only) 
. cd "$rootDir/$resultDir/Tables"
{res}/Users/AliceZhang/Dropbox/Research_Columbia/Renewables Voting (Urpelainen Zhang)/JOP/UZ_JOP2021_Replication/Results/Tables
{txt}
{com}. esttab pro_reduced anti_reduced using TableA21.tex, booktabs replace ///
>                 refcat(cum_capacity_turbine "\emph{c -(}Panel: Reduced Form{c )-}", nolabel) ///
>                 b(%9.3f) se noconstant nonotes legend star(* 0.10 ** 0.05 *** 0.01) ///
>                 varlabels(inter "Mean wind potential * time") varwidth(27) modelwidth(13) ///
>                 mtitles("Pro-Environment Vote" "Anti-Environment Vote") ///
>                 stats(N N_clust r2, labels("Observations" "Districts" "\(R^{c -(}2{c )-}\)") fmt(0 0 2)) ///
>                 width(\hsize)
{res}{txt}(output written to {browse  `"TableA21.tex"'})

{com}.                 
.                 
. ** Close log file
. log close
      {txt}name:  {res}<unnamed>
       {txt}log:  {res}/Users/AliceZhang/Dropbox/Research_Columbia/Renewables Voting (Urpelainen Zhang)/JOP/UZ_JOP2021_Replication/Analysis/logSTATA/008_robustness_comments.smcl
  {txt}log type:  {res}smcl
 {txt}closed on:  {res} 6 Nov 2021, 20:34:10
{txt}{.-}
{smcl}
{txt}{sf}{ul off}